package common

import (
	"github.com/jinzhu/gorm"
	"house-property/model"
)
//var DB *gorm.DB
func InitDB() *gorm.DB{
	db,err:=gorm.Open("postgres", "host=59.110.165.13 port=5432 user=postgres dbname=house-property password=011101")
	if err!= nil {
		panic("failed to connect database,err:" + err.Error())
	}
	db.AutoMigrate(&model.Register_im{})
	db.SingularTable(true)
	//DB=db
	return db
}
//func GetDB() *gorm.DB{
//	return DB
//}